var app = getApp();
var nt_util = require('../../utils/nt_util.js');
Page({
  data: {
    order:{}
    
  },
  onLoad: function () {
    this.getDatas();
  },
  getDatas: function () {
    let buyerId = nt_util.getBuyerId();
    nt_util.httpRequest(nt_util.api.saveLiveOrder, 'POST', {
      buyerId: buyerId
    }, function (data) {
      if(data.code == -1){
        wx.showModal({
          content: data.msg,
          showCancel: false,
          success: function (e) { }
        });
      }else{
        nt_util.that.setData({
          order: data.data.order || {}
        });
      }
      
    });
  },
  onShow: function () {
    nt_util.that = this;
  },
  imgYu: function (event) {

    var current = event.currentTarget.dataset.src;


    //图片预览
    wx.previewImage({
      current: current, // 当前显示图片的http链接
      urls: [this.data.order.qrcode] // 需要预览的图片http链接列表
    })
  }
})